import { Space_GreenHouseRenderData, Space_FieldRenderData } from '../SpaceAssembler';
import * as THREE from 'three';

export function getGreenHouseStructureDatas(): Space_GreenHouseRenderData[] {
  return [
    {
      id: 1,
      basePoint: new THREE.Vector3(0, 0, 0),
      proofType: 'round',
      scale: {
        x: 1,
        y: 1.5,
        z: 2,
      },
      sideTextureMap: {
        front: '3D/building/glass_frontBack.png',
        right: '3D/building/new/gangjia.png',
      },
      preloadCropPlotRawDatas: [
        {
          data: {
            
            id: 1750323040203,
          },
          pointArr: [
            {
              x: 0.02361295493787556,
              y: 0.034270897415106215,
            },
            {
              x: 0.3274849978961298,
              y: 0.034270897415106215,
            },
            {
              x: 0.3274849978961298,
              y: 0.5342708974151062,
            },
            {
              x: 0.02361295493787556,
              y: 0.5342708974151062,
            },
          ],
        },
        {
          data: {
            id: 1750323042734,
          },
          pointArr: [
            {
              x: 0.6667064160039189,
              y: 0.4643637285179008,
            },
            {
              x: 0.9705784589621731,
              y: 0.4643637285179008,
            },
            {
              x: 0.9705784589621731,
              y: 0.9643637285179008,
            },
            {
              x: 0.6667064160039189,
              y: 0.9643637285179008,
            },
          ],
        },
      ],
      preloadDeviceRawDatas: getDeviceDatas(),
    },
    {
      id: 2,
      basePoint: new THREE.Vector3(500, 0, 0),
      proofType: 'round',
      scale: {
        x: 1,
        y: 1.5,
        z: 2,
      },
      sideTextureMap: {
        front: '3D/building/glass_frontBack.png',
        back: '3D/building/glass_frontBack.png',
        left: '3D/building/new/gangjia.png',
        right: '3D/building/new/gangjia.png',
      },
      preloadCropPlotRawDatas: [
        {
          data: {
            id: 1750323040203,
          },
          pointArr: [
            {
              x: 0.02361295493787556,
              y: 0.034270897415106215,
            },
            {
              x: 0.3274849978961298,
              y: 0.034270897415106215,
            },
            {
              x: 0.3274849978961298,
              y: 0.5342708974151062,
            },
            {
              x: 0.02361295493787556,
              y: 0.5342708974151062,
            },
          ],
        },
        {
          data: {
            id: 1750323042734,
          },
          pointArr: [
            {
              x: 0.6667064160039189,
              y: 0.4643637285179008,
            },
            {
              x: 0.9705784589621731,
              y: 0.4643637285179008,
            },
            {
              x: 0.9705784589621731,
              y: 0.9643637285179008,
            },
            {
              x: 0.6667064160039189,
              y: 0.9643637285179008,
            },
          ],
        },
      ],
      preloadDeviceRawDatas: getDeviceDatas(),
    },
    {
      id: 3,
      basePoint: new THREE.Vector3(1000, 0, 0),
      proofType: 'tip',
      scale: {
        x: 1,
        y: 1.5,
        z: 2,
      },
      sideTextureMap: {
        front: '3D/building/glass_frontBack.png',
        // left: '3D/building/new/gangjia.png',
      },
      preloadDeviceRawDatas: getDeviceDatas(),
    },
  ];
}

export function getFieldDatas(): Space_FieldRenderData[] {
  return [
    {
      id: 1,
      basePoint: new THREE.Vector3(250, 0, 0),
      url: '3D/field/field1.fbx',
      scale: {
        base: 1.5,
        x: 1,
        y: 1,
        z: 1,
      },
    },
    {
      id: 2,
      basePoint: new THREE.Vector3(500, 0, 0),
      url: '3D/field/field1.fbx',
      scale: {
        base: 1.5,
        x: 2,
        y: 1,
        z: 2,
      },
    },
  ];
}

export function getDeviceDatas(): Editor.DeviceRawData[] {
  return [
    {
      id: 1750475904754,
      type: 'sideDevice',
      sideType: 'front',
      url: '3D/device/condition.fbx',
      pos: {
        position: {
          x: 330.7755727452999,
          y: 276.25263272225,
          z: -2.5000300420973813,
        },
        quaternion: {
          x: 0,
          y: -1,
          z: 0,
          w: 6.123233995736766e-17,
        },
        scale: {
          base: 1.2,
          x: 1,
          y: 1,
          z: 1,
        },
      },
    },
    {
      id: 1750475869258,
      type: 'sideDevice',
      sideType: 'left',
      url: '3D/device/condition.fbx',
      pos: {
        position: {
          x: 3.8079715333878994,
          y: 303.82626489757547,
          z: -306.1991274029005,
        },
        quaternion: {
          x: 0,
          y: 0.7071067811865475,
          z: 0,
          w: 0.7071067811865476,
        },
        scale: {
          base: 1.2,
          x: 1,
          y: 1,
          z: 1,
        },
      },
    },
  ];
}
